<template>
  <div v-show="isShow" class="toast">
     {{message}}
  </div>
</template>

<script>
  export default{
    name:'',
    data(){
      return {
        message:'',
        isShow:false
      }
    },
    methods:{
      show(message='test',time=3000){
        console.log('1');
        this.message=message
        this.isShow=true
        setTimeout(()=>{
          this.isShow=false
        },time)
      }
    },
    components:{

    }
  }
</script>

<style scoped>
  .toast{
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    background-color: rgba(0,0,0,.6);
    padding: 8px 13px;
    font-size: 20px;
    color: white;
    z-index: 30;
  }
</style>
